﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MRGSP.SurveyMaster.Core.Model.IPageable<MRGSP.SurveyMaster.Core.Model.User>>" %>

<%@ Import Namespace="MRGSP.SurveyMaster.Localization" %>
<%@ Import Namespace="MRGSP.SurveyMaster.WebUI.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%
        Html.RenderPartial("ConfirmDelete"); %>

    <script type="text/javascript">
        $(function() {
                $("#b1").click(function() { window.location = '<%=Url.Action("Create") %>'; });
            });
    </script>

    <button class="fgb" id="b1">
       Create</button>
    <br class="cbt" />
    <br />
    <div class="lgrid">
        <%foreach (var item in Model.Page)
          {%>
        <div class="row">
            <div class="fl cell">
                <%=item.Login %>
            </div>
            <div class="fr">
                <%if (item.Login != User.Identity.Name)
                  {%>
                <div class="fr">
                    <form method="post" action="<%=Url.Action("Delete")%>">
                    <input type="hidden" name="id" value="<%=item.Id%>" />
                    <input type="submit" class="delete" value='<%=MUI.delete%>' />
                    </form>
                </div>
                <%
                    }%>
                <div class="fr">
                    <form action=" <%=Url.Action("Edit", new { id = item.Id}) %>">
                    <input type="submit" value='<%=MUI.edit%>'/>
                    </form>
                </div>
            </div>
        </div>
        <%
            }%>
    </div>
    <br class="cbt" />
    <%=Html.Pagination() %>    
    <br />
</asp:Content>
